<template>
    <ul>
        <li v-for="user in users" :key="user.id">
            {{user.id}}==={{user.name}}=={{user.age}}=={{user.school}}
        </li>
    </ul>
</template>

<script>
    //引入axios组件
    import axios from 'axios'
    export default {
        name:'App',
        data() {
            return {
                users:[]
            }
        },
        //生命周期钩子函数
        mounted(){
            axios.get('http://localhost:8001/hello').then((response)=>{
                this.users=response.data.data;
                console.log("数据传输成功=>",response.data);
            }).catch((error)=>{
                console.log("数据传输失败=>",error.message);
            });
        }
    }
</script>

<style>
   li{
       list-style-type: none;
   }
</style>